package com.yt.fras.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yt.fras.config.MybatisRedisCacheConfig;
import com.yt.fras.pojo.entity.Role;
import com.yt.fras.pojo.entity.UserRole;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Mapper;

/**
 * <p>
 * 用户角色关联表 Mapper 接口
 * </p>
 *
 * @author yt
 * @since 2021-10-25
 */
@Mapper
@CacheNamespace(implementation = MybatisRedisCacheConfig.class, eviction = MybatisRedisCacheConfig.class)
public interface UserRoleMapper extends BaseMapper<UserRole> {

    /**
     * 根据用户获取角色
     *
     * @param userId
     * @return
     */
    Role getRoleByUser(String userId);

}
